package com.coderman.generateSqlBatchTools.bean;

import java.util.Map;

/**
 * Created by ${fanchunshuai} on 2017-4-6.
 *
 * @version: V1.0
 * @Desc:
 * @Copyright (c) 2017 58到家-版权所有
 */
public class SqlBatchBean {
    //读取的excel文件
    private String excelFilePath;

    //如果dataType = 1 则输出sql到指定文件
    private String outPath;

    //数据库db sql的执行类型
    private String exeType;

    //拼接sql导出类型
    private Integer dataType;

    //excel中要操作的列索引号
    private int [] exeColumnIndex;

    //要操作数据库字段的列表
    private Map<String,ColumnBean> columnBeanMap;

    //从多少行读取
    private int fromIndex;



    /**
     * db的操作类型
     * @author fanchunshuai
     *
     */
    public enum ExeType{
        INSERT(1),  //插入
        UPDATE(2),  //修改
        SELECT(3),  //查询
        DELETE(4);  //删除

        private int state;

        ExeType(int state){
            this.setState(state);
        }
        public int getState() {
            return state;
        }
        public void setState(int state) {
            this.state = state;
        }
    }

    /**
     * db的操作类型
     * @author fanchunshuai
     *
     */
    public enum DataType{
        LOGGING(1),     //使用日志进行sql存储
        CONSOLEOUT(2),  //打印到控制台
        FILEOUT(3),     //输出到指定文件
        EXEDB(4);       //sql在DB中执行

        private int type;

        DataType(int state){
            this.setType(type);
        }

        public int getType() {
            return type;
        }

        public void setType(int type) {
            this.type = type;
        }
    }


    public String getExcelFilePath() {
        return excelFilePath;
    }

    public void setExcelFilePath(String excelFilePath) {
        this.excelFilePath = excelFilePath;
    }

    public String getOutPath() {
        return outPath;
    }

    public void setOutPath(String outPath) {
        this.outPath = outPath;
    }

    public String getExeType() {
        return exeType;
    }

    public void setExeType(String exeType) {
        this.exeType = exeType;
    }

    public Integer getDataType() {
        return dataType;
    }

    public void setDataType(Integer dataType) {
        this.dataType = dataType;
    }

    public int[] getExeColumnIndex() {
        return exeColumnIndex;
    }

    public void setExeColumnIndex(int[] exeColumnIndex) {
        this.exeColumnIndex = exeColumnIndex;
    }




}
